<?php

/*
#-----------------------------------------------------------#
#
#  File name: logEngine.php
#  File description: log build engine
#  Built on: 04.10.2008
#  Last modified date: 04.10.2008
#  Last modified by: John
#
#-----------------------------------------------------------#
*/

/*
# Object specifications:
# -
*/

class logEngine {
	var $file = '../log/log.txt';
	
	function add ( $string, $type ) {
	$detailes = array ( 'ip' => $_SERVER['REMOTE_ADDR'],
						'agent' => $_SERVER['HTTP_USER_AGENT']
					  );
		switch ( $type ) {
			case 'start':
			$this -> file = 'log/log.txt';
				$data = "[".date ( 'Y-m-d H:i:s', mktime ( date ('H')+7 ) )."] Tarantula started from: {".$detailes['ip'].", ".$detailes['agent']."}\n";
			break;
			case 'done':
				$data = "[".date ( 'Y-m-d H:i:s', mktime ( date ('H')+7 ) )."] Directory <".$string."> marked as submitted from: {".$detailes['ip'].", ".$detailes['agent']."}\n";
			break;
			case 'junk':
				$data = "[".date ( 'Y-m-d H:i:s', mktime ( date ('H')+7 ) )."] Directory <".$string."> marked as junk from: {".$detailes['ip'].", ".$detailes['agent']."}\n";
			break;
			default:
				$data = "[".date ( 'Y-m-d H:i:s', mktime ( date ('H')+7 ) )."] Error: logEngine.php, line 32 - No such type\n";
			break;
		}
		file_put_contents ( $this -> file, $data, FILE_APPEND );
	}
	
}



?>